package com.huawei.service;

import com.huawei.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        throwable.printStackTrace();
        return new UserService() {
            @Override
            public User getById(Long id){
                return new User(-1L,"开启熔断","系统繁忙骚后重试");
            }
        };
    }
}
